<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>商品查询</title>
    <script src="/jquery/jquery-3.2.1.min.js"></script>
    <script src="/layui/layui.js"></script>
    <link rel="stylesheet" href="/layui/css/layui.css"/>
    <link rel="stylesheet" href="/css/Manageproductlist/productlist-precisesearch.css"/>
</head>
<body>
    <div class="bodr">
       <form class="layui-form" lay-filter="filter">
           <div class="layui-form-item">
               <p>
                   <div class="layui-input-inline mar">
                       优惠券名称： <input type="text" name="couponName" required lay-verify="required" placeholder="优惠券名称" autocomplete="off" class="layui-input inp">
                   </div>

                   <div class="layui-input-inline mar">
                       <div class="layui-input-inline mar">
                           发放方式：
                           <div class="layui-input-inline fontsize inp">
                               <select name="grant" id="stat" lay-verify="required" lay-filter="stat" >
                                   <option value="">请选择状态</option>
                                   <option value="2">自动发放</option>
                                   <option value="3">活动领取</option>
                                   <option value="4">人工发放</option>
                                   <option value="5">无限制</option>
                               </select>
                           </div>
                       </div>
                   </div>
               </p>

               <p>
                   <div class="layui-input-inline mar">
                       开始时间： <input type="text" name="startDate" required lay-verify="required" placeholder="" autocomplete="off" class="layui-input inp">
                   </div>

                   <div class="layui-input-inline mar">
                       结束时间： <input type="text" name="endDate" required lay-verify="required" placeholder="" autocomplete="off" class="layui-input inp">
                   </div>
               </p>
               <p>
                       <div class="layui-input-inline mar">
                       是否启用：
                       <div class="layui-input-inline fontsize inp">
                           <select name="online" lay-verify="required" lay-filter="stat" >
                               <option value="">请选择</option>
                               <option value="2">上线</option>
                               <option value="3">不上线</option>
                           </select>
                       </div>
                   </div>
                </p>
           </div>
           <div style="margin-left:100px ">
               <button type="reset" class="layui-btn ">重置</button>
               <button onclick="search()" type="button" class="layui-btn">搜索</button>
           </div>
       </form>
    </div>
</body>
    <script>
        var $,
            layer,
            form,
            table;

        layui.use(['jquery', 'layer', 'table', 'form'], function () {
            $ = layui.jquery,
                layer = layui.layer,
                form = layui.form,
                table = layui.table;
        });

        //搜索
        search = function search() {
            var data = form.val('filter');
            parent.selCoupon(data.couponName, data.grant, data.online, data.startDate, data.endDate);
            var index = parent.layer.index;
            parent.layer.close(index);
        }
    </script>
</html>